package com.yphone.ui.login.bean.request;

import com.yphone.net.bean.base.BaseRequestInfo;

import org.json.JSONObject;

import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;

public class BaseHttpRequest {


    public Map<String, String> toMapPrames(BaseRequestInfo baseRequestValueInfo) throws Exception {
        Map<String, String> map = new LinkedHashMap<String, String>();
        Class<?> clazz = baseRequestValueInfo.getClass();
        for (Field field : clazz.getDeclaredFields()) {
            field.setAccessible(true);
            String fieldName = field.getName();
            Object value = field.get(baseRequestValueInfo);
            if (value == null) {
                value = "";
            }
            map.put(fieldName, value + "");
        }
        return map;
    }


}
